package com.itheima.array;

import java.util.Scanner;

public class AllTest {
    /*
    需求:评委打分并计算最终的平均得分
    用键盘录入数据
     */
    public static void main(String[] args) {
        int[] arr = new int[6];
        Scanner sc = new Scanner(System.in);
        for (int i = 0; i < arr.length; i++) {
            System.out.println("请"+(i+1)+"打分");
            int score = sc.nextInt();
            if(score >= 0 && score <= 100){
                arr[i]=score;
            }else{
                System.out.println("输入有误");
                i--;
            }
        }
        int sum = 0;
        int max = arr[0];
        int min = arr[0];
        for (int i = 0; i < arr.length; i++) {
            if(arr[i] > max){
                max = arr[i];
            }
        }
        for (int i = 0; i < arr.length; i++) {
            if(arr[i] < min){
                min = arr[i];
            }
        }
        for (int i = 0; i < arr.length; i++) {
            sum += arr[i];
        }
        System.out.println((sum-max-min)/4);
    }
}
